﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Master.Master" Inherits="System.Web.Mvc.ViewPage<OnlineMovieTicket.ViewModels.MoviesStatisticsSearchModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server" >
<link type="text/css" href="<%= Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" /> 
<script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-1.4.2.js") %>" ></script>  
<script type="text/javascript" src="<%= Url.Content("~/Scripts/ui/jquery.ui.core.js") %>"></script> 
<script type="text/javascript" src="<%= Url.Content("~/Scripts/ui/jquery.ui.widget.js") %>"></script> 
<script type="text/javascript" src="<%= Url.Content("~/Scripts/ui/jquery.ui.datepicker.js") %>"></script>     
<script type="text/javascript" src="<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>" ></script>  
<script type="text/javascript" src="<%= Url.Content("~/Scripts/MicrosoftMvcAjax.js") %>" ></script>   
<script type="text/javascript" >
    $(function () {
        var startdate = $('#StartDate').datepicker({ dateFormat: 'dd-MM-yy' });
        var enddate = $('#EndDate').datepicker({ dateFormat: 'dd-MM-yy' });
        
    });

 </script>

<% using (Ajax.BeginForm("ReportFilter", new AjaxOptions { UpdateTargetId = "MoviesStatisticsByRating" }, new AjaxOptions { UpdateTargetId = "MoviesStatisticsByTicket" }))
   { %>

        <table cellpadding="0" cellspacing="0"  class="pageBackGround">
                                    <tr height="10px"><% Html.EnableClientValidation(); %> <% using (Html.BeginForm())
                                                                                              {%></tr>
                                    <tr><td class="fontWhite">
                                        <table bgcolor="white">            
                                            <tr><td>                
                                                <table cellpadding="6" cellspacing="6" width="975px" class="pageBackGround">
                                                    <tr><td class="fontWhiteBold" colspan="3"><h2>Report</h2></td></tr>
                                                    <tr><td>View report by</td><td>:</td>
                                                        <td><%= Html.RadioButton("FilterOption", 0, true)%> Customer Rating &nbsp;&nbsp;&nbsp;<%= Html.RadioButton("FilterOption", 1, false)%> Ticket Sold</td>                                                                                          
                                                    </tr>                                                    
                                                    <tr><td>Start Date</td><td width="1px">:</td><td> <%= Html.TextBox("StartDate", DateTime.Today.Date.ToString("dd-MMM-yyyy"))%>
                                                                                                    <%: Html.ValidationMessageFor(model => model.StartDate)%></td></tr>
                                                    <tr><td>End Date</td><td width="1px">:</td><td> <%= Html.TextBox("EndDate", DateTime.Today.Date.ToString("dd-MMM-yyyy"))%>
                                                                                                      <%: Html.ValidationMessageFor(model => model.EndDate)%></td></tr>                                                                                                                                                                 

                                                    <tr><td colspan="3"><input type="submit" name="ViewButton" value="View" class="btn" /></td></tr>
                                                    <tr><td colspan="3" height="10px"></td>
                                                    </tr>  
                                                    <tr>
                                                    <td colspan="3">
                                                            <div id="MoviesStatisticsByRating">
                                                                <%if (Model.MovieList != null && Model.MovieList.Count() > 0)
                                                                  {
                                                                      Html.RenderPartial("MoviesStatisticsByRating", Model.MovieList);
                                                                  }
                                                                  %>
                                                            </div>
                                                           <div id="MoviesStatisticsByTicket">
                                                                <%if (Model.MovieList != null && Model.MovieList.Count() > 0)
                                                                  {
                                                                      Html.RenderPartial("MoviesStatisticsByTicket", Model.MovieList);
                                                                  } %>
                                                            </div>
                                                    </td></tr>                                          
                                                </table>    
                                                      
                                            </td></tr>
                                        </table>    
                                    </td></tr>
                                    <tr><td height="10px"></td></tr>
                </table>                        
                 <% } %>  
       
    <% } %>
</asp:Content>
